<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewpoint" content="width=device-width, initial-scale=1.0">
    <title>标签管理</title>
    <link href="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet">
    <link href="../../static/css/myCss.css" rel="stylesheet" th:href="@{/css/myCss.css}">
</head>
<body>
<nav th:replace="admin/_fragments :: menu(3)" class="ui inverted attached segment my-padding-tb-mini my-shadow-small">
    <div class="ui container">

        <div class="ui inverted secondary menu stackable">
            <h2 class="ui header teal item">标签管理</h2>
            <a href="#" class="my-item item my-mobile-hide">博客</a>
            <a href="#" class="active my-item item my-mobile-hide">标签</a>
            <a href="#" class="my-item item my-mobile-hide">分类</a>

            <!--            头像-->
            <div class="my-item right menu my-mobile-hide">
                <div class="ui dropdown item">
                    <div class="text">
                        <img class="ui avatar image QR" src="../../static/images/pika.jpg">
                        登陆者用户名
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="menu tooggle ui icon black button my-top-right my-mobile-show"><i class="sidebar icon"></i></a>
</nav>

<!--二级菜单-->
<div class="ui menu attached pointing animated fadeInDown">
    <div class="ui container">

        <div class="right menu">
            <a href="#" th:href="@{/admin/tags/input}" class="item">新增</a>
            <a href="#" th:href="@{/admin/tags}" class="active item teal">列表</a>
        </div>
    </div>
</div>

<div class="my-padding-tb-large my-container-small animated fadeInUp">
    <div class="ui container">
        <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
            <i class="close icon"></i>
            <div class="header">提示：</div>
            <p th:text="${message}">恭喜，操作成功！</p>
        </div>
        <table class="ui table celled ">
            <thead class="center aligned">
            <tr>
                <th></th>
                <th>标签</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody class="center aligned">
            <tr th:each="type,iterStat:${page.content}">
                <td th:text="${iterStat.count}">1</td>
                <td th:text="${type.tagName}">222</td>
                <td>
                    <a href="#" th:href="@{/admin/tags/{id}/input(id=${type.id})}" class="ui mini button teal basic">编辑</a>
                    <a href="#" th:href="@{/admin/tags/{id}/delete(id=${type.id})}" class="ui mini basic button red">删除</a>
                </td>


            </tr>
            </tbody>

            <tfoot>
            <tr>
                <th colspan="6">
                    <div class="ui pagination menu mini" th:if="${page.totalPages}>1">
                        <a th:href="@{/admin/tags(page=${page.number}-1)}" class=" item" th:unless="${page.first}">上一页</a>
                        <a th:href="@{/admin/tags(page=${page.number}+1)}" class=" item" th:unless="${page.last}">下一页</a>
                    </div>
                    <a th:href="@{/admin/tags/input}" class="ui teal basic button right floated mini">新增</a>
                </th>
            </tr>
            </tfoot>
        </table>
    </div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.js"></script>
<script>
    $('.menu.tooggle').click(function () {
        $('.my-item').toggleClass('my-mobile-hide');
    });

    $('.ui.dropdown')
        .dropdown({
            on: "hover"
        })
    ;

    $('.message .close')
        .on('click', function () {
            $(this)
                .closest('.message')
                .transition('fade');
        });
</script>
</body>
</html>